package br.com.almanach.padrao;

import java.io.Serializable;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;

public abstract class Editar< T extends Serializable> {
    
    private Integer id;
    public abstract String salvar();
    public abstract String voltar();
    public abstract void construtor();

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Boolean autorizar(String papel){
        HttpServletRequest httpServletRequest =(HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
        return httpServletRequest.isUserInRole(papel);
    }

}